﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Patent.DBUtility;
using System.Data.SqlClient;

public partial class Web_DelTopic : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string topicID = Request.QueryString["topicID"];
        Session["userName"]="admin";

        SystemError.CreateErrorLog(topicID);

        string userName=Session["userName"].ToString();
        string result="false";
        if (!string.IsNullOrEmpty(topicID))
        {
            SQLHelper helper = new SQLHelper();
            SqlDataReader datarReader;
            helper.RunSQL("exec pro_DeleteTopic " + topicID + ",'"+userName+"'",out datarReader);
            if (datarReader.Read())
            {
                result = datarReader.IsDBNull(0) ? "false" : "true";
            }
            datarReader.Close();
        }
        else
        {
            result = "false";
        }
        Response.Write("{success:"+result+"}");
        Response.End();
        Response.Flush();
    }
}
